package com.example.demo.controller;

import com.example.demo.domain.Result;
import com.example.demo.domain.Staff;
import com.example.demo.service.StaffService;
import jakarta.security.auth.message.callback.PrivateKeyCallback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/staff")
public class StaffController {

    @Autowired
    StaffService staffService;

    //查询员工信息
    @RequestMapping("/findAllStaff")
    public Result findAllStaff(){
        List<Staff> list = staffService.findAllStaff();
        return Result.ok(list);
    }

    //删除员工信息
    @RequestMapping("/deleteStaff")
    public Result deleteStaff(Integer id){
        staffService.deleteStaff(id);
        return Result.ok();
    }
}
